/*
 * @(#)Area.java		       Project:Tools
 * Date:2012-8-14
 *
 * Copyright (c) 2011 CFuture09, Institute of Software, 
 * Guangdong Ocean University, Zhanjiang, GuangDong, China.
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sinaapp.msdxblog.tools.htmlsax.vo;

import java.io.Serializable;

/**
 * @author Geek_Soledad (66704238@51uc.com)
 */
public class Area implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6770217936153633961L;
	private String name;
	private String href;

	public Area(String name, String href) {
		super();
		this.name = name;
		this.href = href;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}

	@Override
	public String toString() {
		return name;
	}

	@Override
	public boolean equals(Object area) {
		if (area == null) {
			return false;
		}
		if (!(area instanceof Area)) {
			return false;
		}
		Area a= (Area) area;
		if (this == a) {
			return true;
		}
		if ((name == null && a.getName() != null)
				|| (href == null && a.getHref() != null)) {
			return false;
		}
		if (name == a.getName() && href == a.getHref()) {
			return true;
		}
		return name.equals(a.getName()) && href.equals(a.getHref());
	}
}
